|
|
|
|
|
|
|
Variables are storage locations for values you use in your applications. Variables have data types, scopes, and lifetimes. You can declare public, module-level, and local variables. Also, you should always declare your variables prior to using them. Whats more, you should come up with a standard for naming your variables. The Variant data type is a heavy-duty variable that requires a lot of overhead and should not be used very often. |
|
|
|
|
|
|
|
|
1. Name four of the different data types supported by Visual Basic. |
|
|
|
|
|
|
|
|
2. Declare three local variables using three of the types you listed in the previous question. (Be sure to use the naming standards.) |
|
|
|
|
|
|
|
|
3. What will the following code display on a form? |
|
|
|
|
|
|
|
|
Dim vntString
vntString = "100"
vntString = vntString + 50
Print vntString |
|
|
|
|
|
|
|
|
2. Add a standard module. |
|
|
|
|
|
|
|
|
3. Add a public variable called gstrName as a String data type. |
|
|
|
|
|
|
|
|
4. Add a public variable called gcurSalary as a Currency data type. |
|
|
|
|
|
|
|
|
5. Add a text box to Form1 called txtEmployee. |
|
|
|
|
|
|
|
|
6. Add a text box to Form1 called txtSalary. |
|
|
|
|
|